package com.lonely.system.engine.upload;

import cn.hutool.extra.spring.SpringUtil;
import com.lonely.common.exception.BusinessException;

/**
 * @author : 黄志标
 * @date: 2025/6/27 13:07
 * @description:
 */
public class FileUploadFactory {


    /**
     * 获取上传实现类
     *
     * @param type
     * @return
     */
    public static FileUploadInterface getFileUpload(UploadTypeEnum type) {
        switch (type) {
            case MINIO:
                return SpringUtil.getBean(MinioFileUpload.class);
            case PIC_GO:
                return SpringUtil.getBean(PicGoFileUpload.class);
        }
        throw new BusinessException("上传类型错误");
    }

}
